import textwrap
import libtcodpy as libtcod
from Gui_Constants import *

game_msgs = []

##
# message
#
# Description: Writes a message to the game log console
#
# Parameters:
#   new_msg - the message to display
#   color - the color to draw the message text in
def message(new_msg, color=libtcod.white):
    global panel
    new_msg_lines = textwrap.wrap(new_msg, MSG_WIDTH)

    for line in new_msg_lines:
        if len(game_msgs) == MSG_HEIGHT:
            del game_msgs[0]

        game_msgs.append((line, color))
